package com.zeng.service;

import com.zeng.dao.UserDao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

/**
 * @author zeng
 * @data 2021/06/05 22:40
 */

public class UserServiceimpl implements UserService{
//    private UserDao userDao = new UserDaoimpl();
    private UserDao userDao;
//    private UserDao userDao = new UserDaoOrcleimpl();
    //动态的注入
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    @Bean
    @Value("UserDaoimpl")
    public UserDao GetUserDao(UserDao userDao) {
        return userDao;
    }


    @Override
    @Bean
    public void getUser() {
        userDao.getUser();
    }



}
